{% macro row(entity,counting=[],adminmode=False) %}

{% import 'snippets/links.jinja' as links %}

{% if entity is mapping and 'title' in entity %}
	{% set img = images.get_track_image(entity) %}
{% elif entity is mapping and 'albumtitle' in entity %}
	{% set img = images.get_album_image(entity) %}
{% else %}
	{% set img = images.get_artist_image(entity) %}
{% endif %}

<td class='icon'>
{% if settings['DISPLAY_ART_ICONS'] %}
    <div class="lazy" data-bg="{{ img }}"></div>
{% endif %}
</td>
{% if entity is mapping and 'title' in entity %}
	{% if settings['TRACK_SEARCH_PROVIDER'] %}
		<td class='searchProvider'>{{ links.link_search(entity) }}</td>
	{% endif %}
	<td class='track'>
		<span class='artist_in_trackcolumn'>{{ links.links(entity.artists, restrict_amount=True) }}</span> – {{ links.link(entity) }}
	</td>
{% elif entity is mapping and 'albumtitle' in entity %}
	<td class='album'>
		<span class='artist_in_albumcolumn'>{{ links.links(entity.artists, restrict_amount=True) }}</span> – {{ links.link(entity) }}
	</td>
{% else %}
	<td class='artist'>{{ links.link(entity) }}
	{% if counting != [] %}
		<span class='extra'>incl. {{ links.links(counting) }}</span>
	{% endif %}
	</td>

{% endif %}


{% if adminmode %}
<td>
{% include 'icons/merge_mark.jinja' %}
{% include 'icons/merge_unmark.jinja' %}
{% if (entity is mapping)  %}
{% include 'icons/association_mark.jinja' %}
{% include 'icons/association_unmark.jinja' %}
{% endif %}
</td>
{% endif %}

{% endmacro %}
